import request from '../request'

export default {
  //获取视频信息
  getVideo(id) {
    return request({
      url: '/api/core/get_video_by_id/' + id,
      method: 'get',
    })
  },

  //检查是否点赞
  checkLike(id) {
    return request({
      url: '/api/core/video_operation/video_like_select/' + id,
      method: 'get',
    })
  },
  //点赞
  like(id) {
    return request({
      url: '/api/core/video_operation/video_like/' + id,
      method: 'post',
    })
  },
  //取消点赞
  cancelLike(id) {
    return request({
      url: '/api/core/video_operation/video_like_cancel/' + id,
      method: 'delete',
    })
  },

  //检查是否收藏
  checkCollect(id) {
    return request({
      url: '/api/core/video_operation/video_collect_select/' + id,
      method: 'get',
    })
  },
  //收藏
  collect(id) {
    return request({
      url: '/api/core/video_operation/video_collect/' + id,
      method: 'post',
    })
  },
  //取消收藏
  cancelCollect(id) {
    return request({
      url: '/api/core/video_operation/video_collect_cancel/' + id,
      method: 'delete',
    })
  },

  //播放数+1
  playAdd(id) {
    return request({
      url: '/api/core/video_operation/video_play/' + id,
      method: 'post',
    })
  },
}
